<template>
  <view :style="{ paddingTop: topHeight + 'px' }">
    <layout-header color="red" title="第二页"></layout-header>
  </view>
</template>

<script>
export default {
  onLoad() {
    //mixin函数获取头部总高度
    const { topHeight } = this.headerHeight();
    this.topHeight = topHeight;
    console.log(this.topHeight);
  },
};
</script>

<style>
</style>